<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <th:block th:include="include :: header('账户列表')" />
</head>

<body class="gray-bg">
<div  class="container-div">
        <div class="wrapper wrapper-content animated fadeInRight">
            <div class="row" th:each="accounts,iterStat : ${sysFnAccounts}">
                <div class="col-md-5 col-lg-offset-3">
                    <div class="payment-card">
                        <h1 class="text-info text-center">
                            [[${accounts.accountName}]]
                        </h1>
                        <div class="row">
                            <div class="col-sm-4">
                                <i class="fa fa-credit-card  payment-icon-big text-warning" >
                                </i>
                            </div>
                            <div class="col-sm-8 text-right">
                                <span class="text-danger" style="font-size: 40px;font-family: Dialog">￥[[${accounts.totalAmount}]]</span>
                            </div>
                        </div>


                        <div class="row">
                            <div class="col-sm-8">
                                <h1 >
                                    <span class="text-success">[[${accounts.accountNo}]]</span>
                                </h1>
                            </div>
                            <div class="col-sm-4 text-right">
                                <h1 class="btn btn-success" th:onclick="rechargeAccount([[${accounts.id}]]);" shiro:hasPermission="system:account:rechargeAccount">
                                    <i class="fa fa-cny"></i> 充值
                                </h1>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-sm-6">
                                <small>
                                   <!-- <strong>账户名称:</strong>  [[${accounts.accountName}]]-->
                                </small>
                            </div>
                            <div class="col-sm-6 text-right">
                                <small>
                                    <small th:text="${#dates.format(accounts.createTime, 'yyyy-MM-dd')}"></small>
                                </small>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
    </div>
    <div class="btn-group-sm" id="toolbar" role="group">
        <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:account:add">
            <i class="fa fa-plus"></i> 添加
        </a>
        <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:account:edit">
            <i class="fa fa-edit"></i> 修改
        </a>
        <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:account:remove">
            <i class="fa fa-remove"></i> 删除
        </a>
    </div>
    <div class="col-sm-12 select-table table-striped">
        <table id="bootstrap-table"></table>
    </div>
</div>



<!-- Mainly scripts -->
<th:block th:include="include :: footer" />
</body>
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('system:account:edit')}]];
    var removeFlag = [[${@permission.hasPermi('system:account:remove')}]];
    var prefix = ctx + "system/account";

    $(function() {
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "账户",
            columns: [{
                checkbox: true
            },
                {
                    field: 'id',
                    title: '主键id',
                    visible: false
                },
                {
                    field: 'accountNo',
                    title: '账户号'
                },
                {
                    field: 'accountName',
                    title: '账户名称'
                },
                {
                    field: 'totalAmount',
                    title: '账户总金额'
                },
                {
                    field: 'freezeAmount',
                    title: '账户冻结金额'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);


    });
    function rechargeAccount(id) {
        var url = prefix + '/rechargeAccount/'+id;
        $.modal.open("账户充值", url);
    }
</script>
</html>
